package com.totoro.view.tags;

import lombok.Getter;
import lombok.Setter;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;
import java.io.StringWriter;

/**
 * @author TOTORO
 * @date 2021/7/12 18:15
 * 过滤关键字为Span高亮标签，仅限于产品搜索列表高亮显示
 */
@Getter
@Setter
public class SearchPageKeywordsTag extends SimpleTagSupport {
    private String value;

    @Override
    public void doTag() throws JspException, IOException {
        JspWriter out = this.getJspContext().getOut();
        // 1.获取标签体内容
        StringWriter sw = new StringWriter();
        this.getJspBody().invoke(sw);
        sw.close();
    }
}
